#!/usr/bin/python
import sys

reader = open('script/a.mk')
writer = open('script/lp.kcfg','w')
line = '1'


writer.write(
	'menu "Project manger"\n'
	'choice\n'
		'\tprompt "Select project"\n\n\n'
	);

while line != '' and line != None:
	line = reader.readline()

	# TODO comment
	if line.startswith('#') :
		continue

	if line.find("=script") != -1:
		line=line.replace('\n','')
		line=line.replace('\t','')
		line=line.replace('\r','')
		name = line.split('=')
		# write: bool "xxxxxx\n"
		writer.write(
			'config dp_' + name[0] + '\n'
				'\tbool  \"' + line + '\"\n');

writer.write('\n\nendchoice\n'
	'endmenu\n');
reader.close()
writer.close()